home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / What's New? / Software Development Kits / Mac OS USB DDK / MacOS USB DDK 1.0b4 / NeptuneDDK / Examples / SerialBox / ShimSerialInternal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-06-26  |  15.6 KB  |  608 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        ShimSerialInternal.h
  3.  
  4.     Contains:    Definitions for the PC Card Serial Driver
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                xxx put dri here xxx
  13.  
  14.         Other Contact:        xxx put other contact here xxx
  15.  
  16.         Technology:            xxx put technology here xxx
  17.  
  18. */
  19.  
  20. #ifndef    _APPLE_ShimSERIALINTERNAL_
  21. #define    _APPLE_ShimSERIALINTERNAL_
  22.  
  23. #include <CommResources.h>
  24. #include <CRMSerialDevices.h>
  25. #include <Devices.h>
  26. #include <DriverServices.h>
  27. #include <Interrupts.h>
  28. #include <NameRegistry.h>
  29. //#include <PCCard.h>
  30. #include <Serial.h>
  31. #include <Types.h>
  32.  
  33. #include "USB.h"
  34. #include "processes.h"
  35.  
  36.  
  37.  
  38.  
  39. //    UART Specific Stuff
  40.  
  41.  
  42. //    a hardwired value for the UART's clock speed
  43. //    it's industry standard and I can't find a way
  44. //    to get this info from a tuple...  so...
  45.  
  46. #define    kUARTCrystalSpeed        1843200            //    1.8432 mhz
  47.  
  48.  
  49.  
  50.  
  51.  
  52. //    masks for uart line control register
  53.  
  54. #define kLen8Bits                0x03
  55. #define kLen7Bits                0x02
  56. #define kLen6Bits                0x01
  57. #define kLen5Bits                0x00
  58.  
  59. #define kStop1Bit                0x00
  60. #define kStop1_5Bits            0x04            //    with len5Bits
  61. #define kStop2Bits                0x04            //    with len6Bits - len8Bits
  62.  
  63. #define kParNone                0x00
  64. #define kParOdd                    0x08
  65. #define kParEven                0x18
  66. #define kParHigh                0x28
  67. #define kParLow                    0x38
  68.  
  69. #define kParStick                0x20
  70. #define kSetBreak                0x40
  71. #define kDLABSelect                0x80
  72.  
  73.  
  74. // FSM states ...
  75. typedef enum state_tag 
  76. {
  77.    kUnConfigured       = 0,
  78.    kConfiguring        = 1,
  79.    kConfigured         = 2
  80. } state;
  81.  
  82. // FSM events ...
  83. typedef enum event_tag 
  84. {
  85.    kNone                                          = 0,
  86.    kGetDescriptors                              = 1,
  87.    kUSBGetFullConfigurationDescriptorComplete  = 2,
  88.    kUSBFindNextInterfaceDescriptorComplete     = 3,
  89.    kUSBFindNextEndpointDescriptorComplete      = 4,
  90.    kExit                                          = 5,
  91.    kConfigure                                  = 6,
  92.    kBug                                        = 666
  93. } event;
  94.  
  95. // FSM transitions ...
  96. typedef enum transition_tag 
  97. {
  98.    kInitial        = 0,
  99.    kStarting       = 1
  100. } transition;
  101.  
  102. //    masks for the uart interrupt enable register
  103.  
  104. #define kRXDataIntEnable        0x01
  105. #define kTXEmptyIntEnable        0x02
  106. #define kRXStatusIntEnable        0x04
  107. #define kModemIntEnable            0x08
  108.  
  109.  
  110.  
  111.  
  112.  
  113. //    masks for uart interrupt identification register
  114.  
  115. #define kInterruptIDMask        0x0F
  116. #define    kNoInterrupt            0x01
  117. #define kModemStatusInterrupt    0x00
  118. #define kTXEmptyInterrupt        0x02
  119. #define kRXDataInterrupt        0x04
  120. #define kRxStatusInterrupt        0x06
  121. #define    kCharTimeoutInterrupt    0x0C
  122. #define kFIFOsEnabled            0xC0            //    on 16550A, both bits 6 & 7 will be set, indicating fifos enabled
  123.  
  124.  
  125.  
  126.  
  127.  
  128. //    masks for uart fifo control register (write to the interrupt id reg)
  129.  
  130. #define kFIFOEnable                0x01
  131. #define kFIFOClearRcvr            0x02
  132. #define kFIFOClearXmit            0x04
  133. #define kDMAMutliXfer            0x08
  134.  
  135.  
  136.  
  137.  
  138.  
  139. //    trigger values for uart fifo control register
  140.  
  141. #define kFIFOTrigger1            0x00
  142. #define kFIFOTrigger4            0x40
  143. #define kFIFOTrigger8            0x80
  144. #define kFIFOTrigger14            0xC0
  145.  
  146.  
  147.  
  148.  
  149.  
  150. //    masks for uart modem control register
  151.  
  152. #define kDTREnable                0x01
  153. #define kRTSEnable                0x02
  154. #define kIntEnable                0x08
  155.  
  156.  
  157.  
  158.  
  159.  
  160. //    masks for uart line status register
  161.  
  162. #define kRxDataAvail            0x01
  163. #define kOverrunErr                0x02
  164. #define kParityErr                0x04
  165. #define kFramingErr                0x08
  166. #define kBreakDetect            0x10
  167. #define kRxErrMask                0x1E
  168. #define kTHREmpty                0x20
  169. #define kShiftEmtpy                0x40
  170.  
  171.  
  172.  
  173.  
  174.  
  175. //    masks for uart modem status register
  176.  
  177. #define kCTSChanged                0x01
  178. #define kCTSCompliment            0x10
  179.  
  180. #define kDSRChanged                0x02
  181. #define kDSRCompliment            0x20
  182.  
  183. #define kRIChanged                0x04
  184. #define kRICompliment            0x40
  185.  
  186. #define kDCDChanged                0x08
  187. #define kDCDCompliment            0x80
  188.  
  189.  
  190.  
  191.  
  192.  
  193. //    masks for pin replacement register
  194.  
  195. #define kPRRdyBsy                0x02
  196. #define kPRCRdyBsy                0x20
  197.  
  198.  
  199.  
  200.  
  201.  
  202. //    masks for config options register
  203.  
  204. #define kConfigOptComSel        0x03
  205. #define kConfigOptCdEnable        0x20
  206. #define kConfigOptLevIREQ        0x40
  207. #define kConfigOptSReset        0x80
  208.  
  209.  
  210.  
  211.  
  212.  
  213. //    masks for config status register
  214.  
  215. #define kConfigStatPwrDwn        0x04
  216. #define kConfigStatAudio        0x08
  217. #define kConfigStatRI            0x10
  218. #define kConfigStatIOIs8        0x20
  219. #define kConfigStatSigChg        0x40
  220. #define kConfigStatChanged        0x80
  221.  
  222.  
  223.  
  224.  
  225.  
  226. //    the uart registers
  227.  
  228. typedef struct {
  229.     UInt8 RBR;                //    uart read buffer register                    (read only)
  230.     UInt8 IER;                //    uart interrupt enable register                (write only)
  231.     UInt8 IIR;                //    uart interrupt identification register        (read only)
  232.     UInt8 LCR;                //    uart line control register
  233.     UInt8 MCR;                //    uart modem control register
  234.     UInt8 LSR;                //    uart line status register
  235.     UInt8 MSR;                //    uart modem status register
  236.     UInt8 SCR;                //    uart scratchpad register
  237. } UART;
  238.  
  239. #define THR    RBR                //    uart fifo transmit holding buffer (@ RBR)    (write only)
  240. #define FCR IIR                //    uart fifo control register (@ IIR)            (write only)
  241. #define DLL RBR                //    uart fifo divisor latch lsb (@ RBR)
  242. #define DLM IER                //    uart fifo divisor latch msb (@ IER)
  243.  
  244.  
  245.  
  246.  
  247.  
  248. enum
  249. {
  250.     kBuiltInBufferSize    =    512,
  251.     kMaxBaudRate        =    115200
  252. };
  253.  
  254.  
  255.  
  256.  
  257.  
  258. // Name Registry defines
  259.  
  260. #define    kNamePropertyName                "name"
  261.  
  262.  
  263.  
  264.  
  265.  
  266. //    UPP info used for driver routines
  267.  
  268. //typedef UniversalProcPtr DriverUPP;
  269.  
  270. enum {
  271.     uppDriverProcInfo = kRegisterBased
  272.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  273.         | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  274.         | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(ParmBlkPtr)))
  275.         | REGISTER_ROUTINE_PARAMETER(2, kRegisterA1, SIZE_CODE(sizeof(DCtlPtr)))
  276. };
  277.  
  278.  
  279.  
  280.  
  281.  
  282. // UPP info used to install the ".In" and ".Out" routines in the driver table
  283.  
  284. typedef UniversalProcPtr InstallDriverUPP;
  285.  
  286. enum {
  287.     uppInstallDriverProcInfo = kRegisterBased
  288.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  289.          | REGISTER_RESULT_LOCATION(kRegisterD0)
  290.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterA0, SIZE_CODE(sizeof(Ptr)))
  291.          | REGISTER_ROUTINE_PARAMETER(2, kRegisterD0, SIZE_CODE(sizeof(DriverRefNum)))
  292. };
  293.  
  294. #define NewInstallDriverProc(userRoutine)        \
  295.         (InstallDriverUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppInstallDriverProcInfo, GetCurrentArchitecture())
  296.  
  297. #define CallInstallDriverProc(userRoutine, newDrvrPtr, refNum)        \
  298.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppInstallDriverProcInfo, (newDrvrPtr), (refNum))
  299.  
  300.  
  301.  
  302.  
  303.  
  304. // UPP info used to remove the ".In" and ".Out" routines in the driver table
  305.  
  306. typedef UniversalProcPtr RemoveDriverUPP;
  307.  
  308. enum {
  309.     uppRemoveDriverProcInfo = kRegisterBased
  310.          | RESULT_SIZE(SIZE_CODE(sizeof(OSErr)))
  311.          | REGISTER_RESULT_LOCATION(kRegisterD0)
  312.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(DriverRefNum)))
  313. };
  314.  
  315. #define NewRemoveDriverProc(userRoutine)        \
  316.         (RemoveDriverUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppRemoveDriverProcInfo, GetCurrentArchitecture())
  317.  
  318. #define CallRemoveDriverProc(userRoutine, refNum)        \
  319.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppRemoveDriverProcInfo, (refNum))
  320.  
  321.  
  322.  
  323.  
  324.  
  325. //
  326. // UPP info used to make the IODone call because IOCommandIsComplete won't work with this combination
  327. // of an native model driver and 68k model drivers.
  328. //
  329.  
  330. typedef UniversalProcPtr IODoneUPP;
  331.  
  332. enum {
  333.     uppIODoneProcInfo =        kRegisterBased
  334.                         |    REGISTER_ROUTINE_PARAMETER(1, kRegisterA1, SIZE_CODE(sizeof(DCtlPtr)))
  335.                         |    REGISTER_ROUTINE_PARAMETER(2, kRegisterD0, SIZE_CODE(sizeof(OSErr)))
  336. };
  337.  
  338. #define CallIODoneProc(userRoutine, dce, result)        \
  339.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIODoneProcInfo, (dce), (result))
  340.  
  341.  
  342.  
  343.  
  344.  
  345. //
  346. //
  347. //    device driver data structure
  348. //
  349. //    this is the header of a device driver
  350. //    i don't suppose it is declared in the system header files
  351. //    at any rate, it has been adapted to suit my needs...
  352. //
  353. //
  354. #if GENERATINGPOWERPC
  355. #pragma options align=mac68k
  356. #endif
  357.  
  358. struct EJFDRVRHeader {
  359.     short                        drvrCtlFlags;
  360.     short                        drvrDelay;
  361.     short                        drvrEMask;
  362.     short                        drvrMenu;
  363.     short                        drvrOpen;
  364.     short                        drvrPrime;
  365.     short                        drvrControl;
  366.     short                        drvrStatus;
  367.     short                        drvrClose;
  368.     unsigned char                drvrName[14];
  369.     
  370.     RoutineDescriptor            ShimSerialStubOpen;
  371.     RoutineDescriptor            ShimSerialStubPrime;
  372.     RoutineDescriptor            ShimSerialStubControl;
  373.     RoutineDescriptor            ShimSerialStubStatus;
  374.     RoutineDescriptor            ShimSerialStubClose;
  375. };
  376. typedef struct EJFDRVRHeader EJFDRVRHeader;
  377.  
  378. typedef EJFDRVRHeader *EJFDRVRHeaderPtr, **EJFDRVRHeaderHandle;
  379.  
  380. #if GENERATINGPOWERPC
  381. #pragma options align=reset
  382. #endif
  383.  
  384.  
  385.  
  386. typedef    struct    ShimSerialGlobals
  387. {
  388. //    volatile UART         *uartRegs;                //    base address of 8250/16450/16550
  389.     
  390. //    InterruptSetMember    interruptSetMember;        //    interrupt tree node
  391. //    InterruptEnabler    interruptEnablerProc;    //    enable UART interrupts
  392. //    InterruptDisabler    interruptDisablerProc;    //    disable UART interrupts
  393.     
  394.     // USB Stuff
  395.     USBPB                      pb;
  396.  
  397.     UInt8                      errorString[256];
  398.     USBDeviceDescriptor        *device;
  399.     USBConfigurationDescriptor *conf;
  400.     USBInterfaceDescriptor     *interface;
  401.     UInt32                     offset;
  402.     USBEndPointDescriptor      *ep[3];
  403.     USBDeviceRef               theModem;
  404.     USBPipeRef                 bulkIn;
  405.     USBPipeRef                 bulkOut;
  406.     USBPipeRef                 interrupt;
  407.     int                        onError;
  408.     int                        retries;
  409.  
  410.     //    input buffers
  411.     UInt8                builtInBuffer[kBuiltInBufferSize];    //    default input buffer
  412.     UInt8                 *inBufPtr;                            //    pointer to current input buffer
  413.     UInt16                inBufLen;                            //    length of said buffer
  414.     UInt16                inBufStartIndex;                    //    circular queue indexes
  415.     UInt16                inBufEndIndex;
  416.     
  417.     //    serial driver state
  418.     
  419.     UInt8                xOnOffChar;            //    an xon or xoff char to be sent
  420.     UInt8                lenParStop;            //    length, parity, stop bits for lcr register
  421.     UInt8                peChar;                //    parity error replacement character
  422.     UInt8                peAltChar;            //    parity error alternate replacement character
  423.     UInt16                baudRate;            //    actual baud rate value i.e. 19200
  424.     SerShk                serShk;                //    handshake record (see inside mac, vol ii, serial drivers
  425.     SerStaRec            serStat;            //    serial status record (see inside mac, vol ii, serial drivers)
  426.     UInt32                UARTCrystalSpeed;    //  retrieved by doing a Get_CAPS device request
  427.     
  428.     //    stub drivers designed to work with serial driver model
  429.     
  430.     EJFDRVRHeaderPtr    drvrIn;                    //    driver header for the input dce
  431.     DriverRefNum        refNumIn;                //    reference number for the input driver
  432.     DCtlHandle            dceIn;                    //    input dce for serial/modem card
  433.     ParmBlkPtr            pbIn;                    //    current prime read request
  434.     EJFDRVRHeaderPtr    drvrOut;                //    driver header for the output dce
  435.     DriverRefNum        refNumOut;                //    reference number for the output driver
  436.     DCtlHandle            dceOut;                    //    output dce for serial/modem card
  437.     ParmBlkPtr            pbOut;                    //    current prime write request
  438.     
  439.     CRMRecPtr            crm;                    //    structures for the registering with crm
  440.     CRMSerialPtr        crmser;
  441.     
  442.     //    socket information
  443.     
  444. //    RegEntryID            cardRef;
  445. //    RegEntryID            deviceRef;
  446. //    UInt32                socketNumber;
  447. //    UInt32                deviceNumber;
  448.     
  449.     //    miscellaneous hackery
  450.     
  451. //    Boolean                useFIFO;            //    we’re running w/ a 16550A!
  452.     Boolean                openSession;        //  only allow one open session
  453.  
  454. } ShimSerialGlobals;
  455.  
  456. extern    ShimSerialGlobals        *gGlobals;
  457.  
  458.  
  459.  
  460.  
  461.  
  462. /********************************************************************************************/
  463. //
  464. //    Prototypes
  465. //
  466. /********************************************************************************************/
  467.  
  468.  
  469. //    ShimSerialUtils.c
  470. void *GetDeviceProperty(const RegEntryID *entryID,const RegPropertyName *propertyName,RegPropertyValueSize *propertySize);
  471. void DisposeDeviceProperty(void *propertyToDispose);
  472.  
  473.  
  474.  
  475. //    ShimSerialRoutines.c
  476. OSStatus    DoDriverIO(            AddressSpaceID spaceID,
  477.                                 IOCommandID            ioCommandID,
  478.                                 IOCommandContents    ioCommandContents,
  479.                                 IOCommandCode        ioCommandCode,
  480.                                 IOCommandKind        ioCommandKind);
  481.  
  482. OSStatus DoInitialization(SInt16 refNum,const RegEntryIDPtr deviceEntry,Boolean replacing);
  483. OSStatus DoFinalization(SInt16 refNum,const RegEntryIDPtr deviceEntry,Boolean beingReplaced);
  484. OSStatus DoOpen(ParmBlkPtr pb);
  485. OSStatus DoClose(ParmBlkPtr pb);
  486. OSStatus DoRead(IOCommandID ioCommandID,IOParam *pb);
  487. OSStatus DoWrite(IOCommandID ioCommandID,IOParam *pb);
  488. OSStatus DoKillIO(IOCommandID ioCommandID,IOParam *pb);
  489. OSStatus DoControl(CntrlParam *pb);
  490. OSStatus DoStatus(CntrlParam *pb);
  491. OSStatus DoDriverGestalt(CntrlParam *pb);
  492.  
  493. OSStatus DoOpenSession(ParmBlkPtr pb);
  494. OSStatus DoCloseSession(ParmBlkPtr pb);
  495.  
  496. OSStatus GetUARTBaseAddress(const RegEntryID *deviceEntry,UART **baseAddress);
  497.  
  498.  
  499.  
  500.  
  501.  
  502. //    UART Routines
  503. //
  504. //        NOTE: We kept the “B_” names from Byrd, the Daffy Duck/M2
  505. //        PC Card Serial Enabler, so we could easily find the original
  506. //        code.  I’ll probably fix this soon.
  507.  
  508. //    driver I/O routines
  509. OSErr    B_Read(ShimSerialGlobals * globals, IOCommandID    ioCommandID, IOParam * pb);
  510. OSErr    B_Write(ShimSerialGlobals * globals, IOCommandID    ioCommandID, IOParam *    pb);
  511. OSErr    B_FillReadRequest(ShimSerialGlobals * globals, IOParam * pb);
  512.  
  513.  
  514.  
  515.  
  516.  
  517. //    driver control call routines
  518. OSErr    B_SerReset(ShimSerialGlobals * globals, UInt16 config);
  519. OSErr    B_SetBuffer(ShimSerialGlobals * globals, Ptr newBuf, UInt16 bufLen);
  520. void    B_SetSerShk(ShimSerialGlobals * globals, SerShk *shkNew, UInt16 csCode);
  521. void    B_SendXOn(ShimSerialGlobals * globals, Boolean always);
  522. void    B_SendXOff(ShimSerialGlobals * globals, Boolean always);
  523. void    B_EnableDTR(ShimSerialGlobals * globals, Boolean enable);
  524. void     B_EnableRTS(ShimSerialGlobals * globals, Boolean enable);
  525. void    B_SetBreak(ShimSerialGlobals * globals, Boolean setBreak);
  526. void     B_SetLenParStop(ShimSerialGlobals * globals, UInt8 lenParStop);
  527. UInt16    B_SetBaudRate(ShimSerialGlobals * globals, UInt32 baudRate);
  528. void    B_SetParErrChar(ShimSerialGlobals * globals, Boolean alt, char peChar, char peAltChar);
  529.  
  530.  
  531.  
  532.  
  533.  
  534. //    driver status call routines
  535. void    B_SerStatus(ShimSerialGlobals * globals, SerStaRec *statRec);
  536. UInt32    B_SerGetBuf(ShimSerialGlobals * globals);
  537.  
  538.  
  539.  
  540.  
  541.  
  542. //    handling card services device interrupt
  543. InterruptMemberNumber    B_UARTInterrupt(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);
  544.  
  545. void    B_UARTModemStatus(ShimSerialGlobals * globals);
  546. void    B_UARTOutput(ShimSerialGlobals * globals);
  547. void    B_UARTInput(ShimSerialGlobals * globals);
  548.  
  549.  
  550.  
  551.  
  552.  
  553. //    controlling the modem card uart
  554. void B_EnableSerialDevice(ShimSerialGlobals * globals);
  555. void B_DisableSerialDevice(ShimSerialGlobals * globals);
  556. void B_InputFlowControl(ShimSerialGlobals * globals);
  557. void B_EnableInput(ShimSerialGlobals * globals, Boolean enable);
  558. void B_EnableOutput(ShimSerialGlobals * globals);
  559.  
  560.  
  561.  
  562.  
  563.  
  564. //    ShimSerialStub.c
  565. OSErr initUSBStuff(USBDeviceRef device, USBDeviceDescriptorPtr pDesc);
  566. OSErr InstallDriverControlEntries(void);
  567. Boolean UniqueDrvrName(StringPtr name);
  568. void GetUniqueDrvrName(StringPtr name,StringPtr base);
  569. short GetUniqueRefNum(void);
  570. OSErr InstallCRM(void);
  571. void GetUniqueCRMPortName(StringPtr name);
  572. void RemoveCRM(void);
  573. OSErr RemoveDriverControlEntries (void);
  574. OSErr ShimSerialStubOpen(ParmBlkPtr pb,DCtlPtr dce);
  575. OSErr ShimSerialStubClose(ParmBlkPtr pb,DCtlPtr dce);
  576. OSErr ShimSerialStubPrime(ParmBlkPtr pb,DCtlPtr dce);
  577. OSErr ShimSerialStubControl(ParmBlkPtr pb,DCtlPtr dce);
  578. OSErr ShimSerialStubStatus(ParmBlkPtr pb,DCtlPtr dce);
  579. void ShimSerialStubIODone(ParmBlkPtr pb,DCtlPtr dce,OSErr result);
  580.  
  581.  
  582. // SerialBox.c
  583. void serialBoxEntry(USBDeviceRef device, USBDeviceDescriptor *desc);
  584. static void StartStatusMonitor(USBPipeRef interruptPipe);
  585. static void InitializePB(USBPB *pb, USBDeviceRef ref, USBCompletion handler);
  586. void USBStartReadPolling(void);
  587. Boolean TimeoutPreviousRequest(void);
  588. void USBSetBaudRateDivisor(UInt16 divisor);
  589. void USBSetParChar(UInt8 parChar);
  590. void USBSetStopBits(UInt16 stopBits);
  591. void USBSetDataBits(UInt16 dataBits);
  592. void USBSetParityBits(UInt16 parityBits);
  593. void USBSetControl(UInt16 state);
  594. void USBSetDTRState(Boolean state);
  595. UInt32    USBGetModemStatus(void);
  596. void USBSetBreakState(Boolean state);
  597. void USBSetRTSState(Boolean state);
  598. void ShimInput(UInt8 *buf, UInt32 count);
  599. void readCompletion(USBPB *pb);
  600. void USBStartReadPolling();
  601. void USBStopReadPolling();
  602. void writeCompletion(USBPB *pb);
  603. OSStatus USBSerialWrite(IOParam *pb);
  604. void KillUSBIO(void);
  605.  
  606.  
  607. #endif    /* _APPLE_ShimSERIALINTERNAL_ */
  608.